package com.jd.sunny.java;

import java.text.ParseException;
import java.text.SimpleDateFormat;


/**
 * @Description:
 * @author:sunlin
 * @since:2012-12-04 13:28
 * @version:1.0.0
 */
public class TestClone {

    public static void main(String[] args) throws CloneNotSupportedException, InterruptedException, ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Employee employee1 = new Employee();
        employee1.setEntryTime(sdf.parse("1990-1-1"));
        Cat cat =  new Cat();
        cat.setName("xiaomao");
        employee1.setCat(cat);

        Employee employee2 = employee1.clone();
        Cat cat2 =  employee2.getCat();
        cat2.setName("xiaomaomi");
        System.out.println(employee1.toString());
        System.out.println(employee2.toString());
    }

}
